<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Rails::Generator::Manifest</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Rails::Generator::Manifest</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/rails/railties/lib/rails_generator/manifest_rb.html">
                vendor/rails/railties/lib/rails_generator/manifest.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
<a href="Manifest.html">Manifest</a> captures the actions a generator
performs. Instantiate a manifest with an optional target object, hammer it
with actions, then <a href="Manifest.html#M001549">replay</a> or <a
href="Manifest.html#M001550">rewind</a> on the object of your choice.
</p>
<p>
Example:
</p>
<pre>
  manifest = Manifest.new { |m|
    m.make_directory '/foo'
    m.create_file '/foo/bar.txt'
  }
  manifest.replay(creator)
  manifest.rewind(destroyer)
</pre>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M001551">erase</a>&nbsp;&nbsp;
      <a href="#M001548">method_missing</a>&nbsp;&nbsp;
      <a href="#M001547">new</a>&nbsp;&nbsp;
      <a href="#M001549">replay</a>&nbsp;&nbsp;
      <a href="#M001550">rewind</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">target</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M001547" class="method-detail">
        <a name="M001547"></a>

        <div class="method-heading">
          <a href="#M001547" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(target = nil) {|self if block_given?| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Take a default action target. Yield self if block given.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001547-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001547-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/railties/lib/rails_generator/manifest.rb, line 19</span>
19:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">target</span> = <span class="ruby-keyword kw">nil</span>)
20:         <span class="ruby-ivar">@target</span>, <span class="ruby-ivar">@actions</span> = <span class="ruby-identifier">target</span>, []
21:         <span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
22:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M001551" class="method-detail">
        <a name="M001551"></a>

        <div class="method-heading">
          <a href="#M001551" class="method-signature">
          <span class="method-name">erase</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Erase recorded actions.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001551-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001551-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/railties/lib/rails_generator/manifest.rb, line 40</span>
40:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">erase</span>
41:         <span class="ruby-ivar">@actions</span> = []
42:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001548" class="method-detail">
        <a name="M001548"></a>

        <div class="method-heading">
          <a href="#M001548" class="method-signature">
          <span class="method-name">method_missing</span><span class="method-args">(action, *args, &amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Record an action.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001548-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001548-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/railties/lib/rails_generator/manifest.rb, line 25</span>
25:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">action</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
26:         <span class="ruby-ivar">@actions</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">action</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>]
27:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001549" class="method-detail">
        <a name="M001549"></a>

        <div class="method-heading">
          <a href="#M001549" class="method-signature">
          <span class="method-name">replay</span><span class="method-args">(target = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Replay recorded actions.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001549-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001549-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/railties/lib/rails_generator/manifest.rb, line 30</span>
30:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">replay</span>(<span class="ruby-identifier">target</span> = <span class="ruby-keyword kw">nil</span>)
31:         <span class="ruby-identifier">send_actions</span>(<span class="ruby-identifier">target</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@target</span>, <span class="ruby-ivar">@actions</span>)
32:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001550" class="method-detail">
        <a name="M001550"></a>

        <div class="method-heading">
          <a href="#M001550" class="method-signature">
          <span class="method-name">rewind</span><span class="method-args">(target = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Rewind recorded actions.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001550-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001550-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/railties/lib/rails_generator/manifest.rb, line 35</span>
35:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rewind</span>(<span class="ruby-identifier">target</span> = <span class="ruby-keyword kw">nil</span>)
36:         <span class="ruby-identifier">send_actions</span>(<span class="ruby-identifier">target</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@target</span>, <span class="ruby-ivar">@actions</span>.<span class="ruby-identifier">reverse</span>)
37:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>